// JavaScript Document

/* hide */
function he(elm) {
	document.getElementById(elm).style.display = 'none';
}
/* show */
function se(elm) {
	document.getElementById(elm).style.display = '';
}
/* disable */
function de(elm) {
	document.getElementById(elm).disabled = true;
}
/* enable */
function ee(elm) {
	document.getElementById(elm).disabled = false;
}

/* confirm url */
function confirmurl(url, msg) {
	if (confirm(msg)) {
		window.location = url;
	}
}

var poem_share_code_start = '<ul id="crazypoems_list"></ul><script src="http://www.crazypoems.net/js/share_poems_list.js" type="text/javascript"></script><script src="http://www.crazypoems.net/share_poems_data.php';
var poem_share_code_end = '" type="text/javascript"></script>';

function poem_share_code_update(author) {
	var new_code = poem_share_code_start;
	var typeBox = document.getElementById('type_box');
	var numberBox = document.getElementById('number_box');
	var codeBox = document.getElementById('code_box');
	var type = typeBox.options[typeBox.selectedIndex].value;
	var number = numberBox.options[numberBox.selectedIndex].value;
	if (type == 'mine') {
		new_code += '?author='+author+'&limit='+number; 
	} else {
		new_code += '?limit='+number;
	}
	new_code += poem_share_code_end;
	codeBox.value = new_code;
}